2from datetime import datetime


def calculate_age(birthday):
    today = datetime.now()
    age = today.year - birthday.year

    if(today.month,birthday.day)<(birthday.month,birthday.day):
        age -= 1
    return age

def main():
    while True:
       birthday_str = input("Please enter your birthday in the format YYYY-MM-DD: ")

       birthday = datetime.strptime(birthday_str,"%Y-%m-%d")
       
       age = calculate_age(birthday)
       print(f"Your age is {age} years.")


if __name__ == "__main__":
    main()